<!-- search area   -->
<div class="row searchLineWrap">
	<form class="form-horizontal" method="post"
		action="${cxt!}/cms/stationMessage/list" id="searchForm">
		<div class="col-md-12">
			<div class="row">
				<div class="col-md-4">
					<div class="form-group">
						<label class="col-md-5 control-label">${_res["stationMessage.messageTitle"]}</label>
						<div class="col-md-7">
							<input type="text" class="form-control" name="stationMessage.l_title" placeholder="${_res['stationMessage.title']}" value="${paramMap['stationMessage.l_title']}" />
						</div>
					</div>
				</div>

				<div class="col-md-4">
					<div class="form-group">
						<label class="col-md-5 control-label">${_res["stationMessage.startDate"]}</label>
						<div class="col-md-7">
							<input placeholder="${_res['stationMessage.startDate']}" class="form-control layer-date laydate-icon" onclick="laydate()" name="stationMessage.gt_createtime" value="${paramMap['stationMessage.gt_createtime']}">
						</div>
					</div>
				</div>

				<div class="col-md-4">
					<div class="form-group">
						<label class="col-md-4 control-label">${_res["stationMessage.endDate"]}</label>
						<div class="col-md-7">
							<input placeholder="${_res['stationMessage.endDate']}" class="form-control layer-date laydate-icon" onclick="laydate()" name="stationMessage.le_createtime" value="${paramMap['stationMessage.le_createtime']}">
						</div>
					</div>
				</div>
			</div>

			<div class="row">
				<div class="col-md-4">
					<div class="form-group">
						<label class="col-md-5 control-label">${_res["stationMessage.sendObject"]}</label>
						<div class="col-md-7">
							<#dict type="select" name="stationMessage.f_sendobject" table="customer_role" filedName="name" filedValue="id" value="${paramMap['stationMessage.f_sendobject']}"/>
						</div>
					</div>
				</div>

				<div class="col-md-4">
					<div class="form-group">
						<label class="col-md-5 control-label">${_res["stationMessage.sendState"]}</label>
						<div class="col-md-7">
							<#dict type="select" name="stationMessage.f_status" dictCode="SEND_STATUS" value="${paramMap['stationMessage.f_status']}"/>
						</div>
					</div>
				</div>

				<div class="col-md-2">
					<div class="form-group">
						<% if(hasPrivilegeUrl("stationMessageView")){ %>
						<button type="button" class="btn btn-primary pull-right"
							onclick="ajaxForm('content','searchForm')">
							<i class="fa fa-search m-l-sm m-r-xs"></i>${_res["system.search"]}
						</button>
						<% } %>
					</div>
				</div>
			</div>
		</div>
	</form>
</div>
<!-- search area end  -->

<div class="row searchLineWrap">
	<% if(hasPrivilegeUrl("stationMessageAdd")){ %>
	<p>
		<a href="javascript:void(0);"
			onClick="ajaxContent('/cms/stationMessage/add/a');"
			class="btn btn-primary pull-left">${_res["stationMessage.addStationMessage"]}</a>
	</p>
	<% } %>
	<table class="table table-bordered">
		<thead>
			<tr>
				<th>${_res["stationMessage.messageTitle"]}</th>
				<th>${_res["stationMessage.contentDescription"]}</th>
				<th>${_res["stationMessage.sendObject"]}</th>
				<th>${_res["stationMessage.sendState"]}</th>
				<th>${_res["system.createtime"]}</th>
				<th>${_res["stationMessage.sendTime"]}</th>
				<th>${_res["system.operator"]}</th>
			</tr>
		</thead>
		<tbody>
			<% for(item in splitPage.list!){ %>
			<tr >
				<td>${item.title!}</td>
				<td>${item.content!}</td>
				<td width="300px !important"><#dict type="lable" value="${item.sendobject!}" table="customer_role" filedName="name" filedValue="id" /></td>
				<td><#dict type="lable" value='${item.status!}' dictCode="SEND_STATUS"/></td>
				<td>${item.createtime!,dateFormat="yyyy-MM-dd HH:mm"}</td>
				<td>${item.sendtime!,dateFormat="yyyy-MM-dd HH:mm"}</td>
				<td>
				    <% if(hasPrivilegeUrl("stationMessageView")){ %>
						<button type="button" class="btn btn-sm btn-link" onClick="ajaxContent('/cms/stationMessage/view/${item.id!}');">${_res["system.view"]}</button>
					<% } %> 
					<% if(hasPrivilegeUrl("stationMessageEdit")){ %>
						<button type="button" class="btn btn-sm btn-link" onClick="ajaxContent('/cms/stationMessage/update/e-${item.id!}')">${_res["system.edit"]}</button>
					<% } %> 
					<% if(hasPrivilegeUrl("stationMessageDelete")){ %>
						<button type="button" class="btn btn-sm btn-link" onClick="ajaxDelete('/cms/stationMessage/delete/${item.id!}')">${_res["system.delete"]}</button>
					<% } %>
					<% if(hasPrivilegeUrl("stationMessageSend")){ %>
					<p>
					  <a href="javascript:void(0);" onClick="send('${item.id!}')">${_res["stationMessage.send"]}</a>
					</p>
					<% } %>
				</td>
			</tr>
			<% } %>
		</tbody>
	</table>
	<div id="splitPageDiv"><#page formId="searchForm" /></div>
	<#nav />
</div>
<script>
 function send(id){
	var message = "确认发送?";
	if(_locale=='en_US'){
		message = "Are you sure you want to send?"
	}
	var url = "/cms/stationMessage/send";
	var data =  new Object();
	data.id=id; //站内信消息ID
	var confirm = $.scojs_confirm({
	  content: message,
	  action:function(){
		  ajaxContent(url,data);
	      this.close();
	      this.destroy();
	  }
   });	
	confirm.show();
}

 
</script>
